#include <fstream>
#include <iostream>
#include "statistics.h"
#include "NilsHolgersson.h"
#include "Watch.h"
#include <deque>

#include <string>

using namespace std;
using namespace Course;


bool palindrome(string s)
{
	deque<char> dq , stack;
	for (auto i: s)
	{
		dq.push_back(i);
		stack.push_back(i);
	}
	for (int i = 0; i < dq.size(); i++)
	{
		if(dq.front() == stack.back())
		{
			dq.pop_front();
			stack.pop_back();
		}
		else 
			return false;
	}
	return true;
	system("pause");
}

void main2()
{
	statistics s;
	s.readFromFile("salary.txt");
	cout << s.calculate_mean() << endl;
	cout << s.calculate_median() << endl;
	system("pause");
}
void main3()
{
	Watch w;
	NilsHolgersson n;
	w.restart();
	n.readfromfile("nils_holgersson.txt");
	n.frekventord();	
	cout << "Tiden :" << w.elapsedUs().count() << "Us" << endl;
	system("pause");
}

int main()
{
	//main1();
	//main2();
	//main3();
	string s;
	cout << "Write something to check palidrome! " << endl;
	cin >> s;
	palindrome(s);
	if (palindrome(s) == 1)
	{
		cout << "Palindrome! " << endl;
	}
	else
	{
		cout << "Not palindrome! " <<endl;
	}
	system("pause");
}